//
//  TalkingView.m
//  BasketballClub
//
//  Created by 孙鸿吉 on 16/1/18.
//  Copyright © 2016年 孙鸿吉. All rights reserved.
//

#import "TalkingView.h"

@implementation TalkingView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self allViews];
    }
    return self;
}
- (void)allViews
{
    //导航
    self.title = [[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH/2 - (40 * LAYOUT_SIZE), 29 * LAYOUT_SIZE_HEIGHT, 80* LAYOUT_SIZE, 26 * LAYOUT_SIZE_HEIGHT)];
    self.title.text = @"评论";
    self.title.textAlignment = 1;
    self.title.textColor = [UIColor yellowColor];
    self.title.font = [UIFont systemFontOfSize:17 * LAYOUT_SIZE];
    [self addSubview:self.title];
    
    //取消按钮
    self.cancleButton = [[UIButton alloc]initWithFrame:CGRectMake(10 * LAYOUT_SIZE, 29 * LAYOUT_SIZE_HEIGHT, 50 * LAYOUT_SIZE, 26 * LAYOUT_SIZE_HEIGHT)];
    [self.cancleButton setImage:[UIImage imageNamed:@"fanhui"] forState:UIControlStateNormal];
    [self addSubview:self.cancleButton];
    
    self.talkTableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 64 * LAYOUT_SIZE_HEIGHT, SCREEN_WIDTH, SCREEN_HEIGHT - 94 * LAYOUT_SIZE_HEIGHT) style:UITableViewStylePlain];
    
    [self addSubview:self.talkTableView];

    
    self.toolView = [[UIView alloc]initWithFrame:CGRectMake(0, SCREEN_HEIGHT - 40 * LAYOUT_SIZE_HEIGHT, SCREEN_WIDTH, 40 * LAYOUT_SIZE_HEIGHT)];
    self.toolView.backgroundColor = [UIColor colorWithRed:240/255.0 green:240/255.0 blue:242/255.0 alpha:1.0];
    [self addSubview:self.toolView];
    
    
    self.talkTF = [[UITextField alloc]initWithFrame:CGRectMake(10 * LAYOUT_SIZE, 5 * LAYOUT_SIZE_HEIGHT , SCREEN_WIDTH - 20 * LAYOUT_SIZE, 30 * LAYOUT_SIZE_HEIGHT)];
    self.talkTF.placeholder = @"添加说说";
    self.talkTF.layer.masksToBounds = YES;
    self.talkTF.layer.cornerRadius = 8;
    [self.talkTF setValue:[UIFont boldSystemFontOfSize:15 * LAYOUT_SIZE] forKeyPath:@"_placeholderLabel.font"];
    self.talkTF.backgroundColor = [UIColor whiteColor];
    self.talkTF.userInteractionEnabled = NO;
    [self.toolView addSubview:self.talkTF];

}
@end
